/*****************************************************************
 MYD Engine v0.1

 File: myd_texture.cpp
 Created: 26/06/09
*****************************************************************/

#include "myd_texture.h"

using namespace myd;

//----------------------------------------------------------------constructor#1
Texture::Texture (std::string fileName, unsigned long ulColor)
:
m_uiWidth(0),
m_uiHeight(0),
wn_fileName(fileName),
m_ulColor(ulColor),
m_acData(NULL)
{
}
//----------------------------------------------------------------constructor#2
Texture::Texture (std::string name, 
					unsigned int uiWidth, 
					unsigned int uiHeight,
					unsigned int uiPixelDepth,
					char* acData)
:
m_uiWidth(uiWidth),
m_uiHeight(uiHeight),
m_uiPixelDepth(uiPixelDepth),
wn_fileName(name),
m_ulColor(0),
m_acData( new char[uiWidth * uiHeight * uiPixelDepth] )
{
	memcpy(m_acData, acData, uiWidth * uiHeight * uiPixelDepth);
}
//----------------------------------------------------------------destructor
Texture::~Texture ()
{
	delete [] m_acData;
	m_acData = NULL;
}
//----------------------------------------------------------------